#include<cstdio>
#include<cstring>
#include<algorithm>

using namespace std;
const int maxn=2e7+10, P=998244353;

inline int read() {
    int x=0, f=1; char c=getchar();
    for(; c<'0'||c>'9'; c=getchar()) if(c=='-') f=0;
    for(; c>='0'&&c<='9'; c=getchar()) x=x*10+c-'0';
    return f?x:-x;
}
inline int add(int x, int y) {x+=y; return x>=P?x-P:x;}
inline int del(int x, int y) {x-=y; return x<0?x+P:x;}
int n, m;
int id[5][5][5][5][5], p[5];
int d[120][120];

inline void mul(int a[120][120], int b[120][120]) {
    for(int i=0; i<120; ++i)
        for(int j=0; j<120; ++j) d[i][j]=0;
    for(int i=0; i<120; ++i)
        for(int k=0; k<120; ++k)
            for(int j=0; j<120; ++j)
                d[i][j]=add(d[i][j], 1ll*a[i][k]*b[k][j]%P);
    for(int i=0; i<120; ++i)
        for(int j=0; j<120; ++j) a[i][j]=d[i][j];
}
int a[120][120], f[120][120];

int main() {
    freopen("drama.in", "r", stdin);
    freopen("drama.out", "w", stdout);
    n=read(), m=read();
    for(int i=0; i<n; ++i) p[i]=i;
    int cnt=0;
    do{
        id[p[0]][p[1]][p[2]][p[3]][p[4]]=cnt;
        ++cnt;
    }while(next_permutation(p, p+n));
    for(int i=0; i<n; ++i) p[i]=i;
    cnt=0;
    do{
        for(int i=0; i<n; ++i) {
            int x=p[i];
            for(int j=i-1; j>=0; --j) p[j+1]=p[j];
            p[0]=x;
            a[cnt][id[p[0]][p[1]][p[2]][p[3]][p[4]]]=1;
           // printf("%d -> %d\n", cnt, id[p[0]][p[1]][p[2]][p[3]][p[4]]);
            for(int j=1; j<=i; ++j) p[j-1]=p[j];
            p[i]=x;
        }
        ++cnt;
    }while(next_permutation(p, p+n));
    
    f[0][0]=1;
    for(; m; m>>=1, mul(a, a))
        if(m&1) mul(f, a);
    printf("%d", f[0][0]);
    return 0;
}